import { createStore, applyMiddleware } from 'redux'
import rootReducer from './reducers/root.reducer'
import createSagaMiddleware from 'redux-saga'
import todoSaga from './saga/todo.saga'

const sagaMiddleware = createSagaMiddleware()

const store = createStore(rootReducer, applyMiddleware(sagaMiddleware))
sagaMiddleware.run(todoSaga)

console.log(store.getState())

export default store

/**
 * 当前模块：
 * 1、store的创建
 * 2、注册中间件
 */
